<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.zz.bsea.service.UserService" %>
<%@ page import="com.zz.bsea.entity.User" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<%
String uname=(String)session.getAttribute("loginname");
if(uname==null){
	response.sendRedirect("/java11/BseaLogin.jsp");
}

UserService us=new UserService();
List<User> ls=us.showAll();

%>

<div class="container">

 <ul class="nav">
    <li class="nav-item">
      <a class="nav-link" href="#">用户管理</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="/java11/productList.jsp">产品管理</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#">Link</a>
    </li>
    <li class="nav-item">
      <a class="nav-link disabled" href="#">Disabled</a>
    </li>
  </ul>
  <h2>欢迎 <%=uname %>登录</h2>
  <p>.table 类来设置基础表格的样式:</p>            
  <table class="table table-striped table-bordered">
    <thead>
      <tr>
        <th>序号id</th>
<th>用户名</th>
<th>密码</th>
      </tr>
    </thead>
    <tbody>
     <%
for(User user:ls){
	

%>
    <tr>
        <td><%=user.getId() %></td>
        <td><%=user.getName() %></td>
        <td><%=user.getPassword() %></td>
        
      
    </tr>
   <%
}
   %>
     
    </tbody>
  </table>
</div>
</body>
</html>